package com.example.feign.feign;

import com.example.feign.entity.Skill;
import com.example.feign.feign.fallback.SkillFallback;
import com.example.feign.util.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(value = "BASE-SERVICE",fallback = SkillFallback.class)
public interface SkillFeign {
    @RequestMapping(
            value = "/skill/get",
            method = RequestMethod.GET,
            consumes = "application/json")
    public Response getSkill(
            @RequestParam(value = "page",required = false) Integer page,
            @RequestParam(value = "size",required = false) Integer size,
            @RequestParam Map map
    );

    @RequestMapping(
            value = "/skill/getAll",
            method = RequestMethod.GET,
            consumes = "application/json")
    public Response getAllSkill();

    @RequestMapping(value = "/skill/add",method = RequestMethod.POST)
    public Response addSkill(@RequestBody Skill skill);

    @RequestMapping(value = "/skill/update",method = RequestMethod.PUT)
    public Response updateSkill(@RequestBody Skill skill);

    @RequestMapping(value = "/skill/del",method = RequestMethod.PUT)
    public Response delSkill(@RequestParam(value = "skillId", required = true) String skillId);

}
